package dto

import (
	"github.com/gin-gonic/gin"
	"tino_manager/public"
)

type DicDataAddInput struct {
	Pid   string `json:"pid" form:"pid" comment:"父级id"`
	Key   string `json:"key" form:"key" comment:"字典键" validate:"required"`
	Label string `json:"label" form:"label" comment:"字典名称" validate:"required"`
	Value string `json:"value" form:"value" comment:"字典值" validate:"required"`
}

func (params *DicDataAddInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type GetDataByKeyInput struct {
	Key string `json:"key" form:"key" comment:"字典键" validate:"required"`
}

func (params *GetDataByKeyInput) BindValidParam(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

type DicDataInfo struct {
	Id    string `json:"id" form:"id"`
	Key   string `json:"key" form:"key"`
	Label string `json:"label" form:"label"`
	Value string `json:"value" form:"value"`
}
